
//   F - kth.cpp

#include <bits/stdc++.h>

using namespace std;
const int MAXN = 2e5 + 5;
int a[MAXN], b[MAXN], c[MAXN], n, k;
vector<long long> vec;

long long f(int i, int j, int k) {
  return 1ll * a[i] * b[j] + 1ll * b[j] * c[k] + 1ll * c[k] * a[i];
}

int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i)
    scanf("%d", a + i);
  for (int i = 1; i <= n; ++i)
    scanf("%d", b + i);
  for (int i = 1; i <= n; ++i)
    scanf("%d", c + i);
  sort(a + 1, a + n + 1, [](int x, int y) -> bool { return x > y; });
  sort(b + 1, b + n + 1, [](int x, int y) -> bool { return x > y; });
  sort(c + 1, c + n + 1, [](int x, int y) -> bool { return x > y; });
  for (int i = 1; i <= min(n, k); ++i) {
    for (int j = 1; j <= min(n, k / i); ++j) {
      for (int k = 1; k <= min(n, ::k / (i * j)); ++k) {
        vec.push_back(f(i, j, k));
      }
    }
  }
  int target = vec.size() - k + 1;
  for (auto x : vec)
    printf("%d", x);
  nth_element(vec.begin(), vec.begin() + target - 1, vec.end());
  printf("%lld\n", vec[target - 1]);
  return 0;
}
